import request from '@/utils/request'

// 查询订单详细列表
export function listOrderdetails(query) {
  return request({
    url: '/chy/orderdetails/list',
    method: 'get',
    params: query
  })
}

// 查询订单详细详细
export function getOrderdetails(id) {
  return request({
    url: '/chy/orderdetails/' + id,
    method: 'get'
  })
}

// 新增订单详细
export function addOrderdetails(data) {
  return request({
    url: '/chy/orderdetails',
    method: 'post',
    data: data
  })
}

// 修改订单详细
export function updateOrderdetails(data) {
  return request({
    url: '/chy/orderdetails',
    method: 'put',
    data: data
  })
}

// 删除订单详细
export function delOrderdetails(id) {
  return request({
    url: '/chy/orderdetails/' + id,
    method: 'delete'
  })
}

//通过查询订单编号查询订单详细
export function getOrderdetailsByOrderId(orderId) {
  return request({
    url: '/chy/orderdetails/selectOrderDetailsByOrderId/' + orderId,
    method: 'get'
  })
}
// 通过查询服务编号查询服务详细
export function getOrderdetailsByServiceId(serviceId) {
  return request({
    url: '/chy/orderdetails/selectOrderDetailsByServiceId/' + serviceId,
    method: 'get'
  })
}
